// import com->alibaba->druid->string_ptr ;
// import com->alibaba->druid->sql->ast->SQLDbTypedObject;
// import com->alibaba->druid->sql->ast->SQLLimit*;
// import com->alibaba->druid->sql->ast->SQLOrderBy*;
// import com->alibaba->druid->sql->visitor->SQLASTVisitor*;

// import java->util->ArrayList;
// import java->util->Arrays;
// import java->util->Collections;
// import java->util->std::list;
#pragma once

#include <string>
#include <list>

#include "../SQLLimit.h"
#include "../SQLOrderBy.h"
#include "../SQLDbTypedObject.h"

#include "SQLSelectQueryBase.h"
#include "SQLUnionOperator.h"
#include "SQLSelectQueryBlock.h"

class SQLASTVisitor;

class SQLUnionQuery : virtual public SQLSelectQueryBase, virtual public SQLDbTypedObject
{
public:
  static string_ptr class_;
  std::shared_ptr<std::list<SQLSelectQuery_ptr>> relations;
  SQLUnionOperator_ptr operator_;
  SQLOrderBy_ptr orderBy;

  SQLLimit_ptr limit;
  DbType_ptr dbType;

  SQLUnionOperator_ptr getOperator();

  void setOperator(SQLUnionOperator_ptr operator_);

  SQLUnionQuery();

  SQLUnionQuery(DbType_ptr dbType);

  SQLUnionQuery(SQLSelectQuery_ptr left, SQLUnionOperator_ptr operator_, SQLSelectQuery_ptr right);
  SHAREDOBJECT(SQLUnionQuery) ;
  std::shared_ptr<std::list<SQLSelectQuery_ptr>> getRelations();

  bool isEmpty();

  void addRelation(SQLSelectQuery_ptr relation);

  SQLSelectQuery_ptr getLeft();

  void setLeft(SQLSelectQuery_ptr left);

  SQLSelectQuery_ptr getRight();

  void setRight(SQLSelectQuery_ptr right);

  SQLOrderBy_ptr getOrderBy();

  void setOrderBy(SQLOrderBy_ptr orderBy);

  void accept0(SQLASTVisitor_ptr visitor);

  SQLLimit_ptr getLimit();

  void setLimit(SQLLimit_ptr limit);

  virtual SQLObject_ptr clone();
  SQLSelectQueryBlock_ptr getFirstQueryBlock();

  DbType_ptr getDbType();

  void setDbType(DbType_ptr dbType);

  BOOL_ptr replace(SQLSelectQuery_ptr cmp, SQLSelectQuery_ptr target);

  std::shared_ptr<std::list<SQLSelectQuery_ptr>> getChildren();

  bool equals(Object_ptr o);

  int hashCode();

  bool containsAttribute(string_ptr name){};
  void addBeforeComment(string_list_ptr comments){};
  string_list_ptr getAfterCommentsDirect(){};
  string_list_ptr getBeforeCommentsDirect(){};
  void addAfterComment(string_ptr comment){};
  void addAfterComment(string_list_ptr comments){};
  bool hasBeforeComment(){};
  bool hasAfterComment(){};
};
